import cgi
import datetime
import wsgiref.handlers
import gdata.service

from src.Authenticator import Authenticator

from google.appengine.ext import db
from google.appengine.api import users
from google.appengine.ext import webapp

class AuthHandler(webapp.RequestHandler):
    def get(self):
        newToken = self.request.get("token")
        user = users.get_current_user()
        if newToken and user:
            a = Authenticator(user)
            a.Authenticate(newToken)
            
        self.redirect("/")

